﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/AdminSite.Master" AutoEventWireup="true" CodeBehind="quanlylogo.aspx.cs" Inherits="WebRaoVat.Admin.QuanLyLogo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

<div id="blockright">
        <div id="box-pro-highlights-main">
		<div class="content">
        	<div class="box-pro-highlights-main-header">
			    [Logo] Cập nhật hiển thị logo
            </div>
            
            <div style="float:left">
                <asp:Button ID="Button3" runat="server" Text="Cập nhật" 
                onclick="Button3_Click" />
            </div>
            
        </div>
        </div>
        
        
		<div id="box-pro-highlights-main">
		<div class="content">
        	<div class="box-pro-highlights-main-header">
			    Quản lý logo
            </div>
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                AutoGenerateColumns="False" DataKeyNames="MaLogo" DataSourceID="SqlDataSource1">
                <Columns>
                    <asp:CommandField ShowEditButton="True" CancelText="Hủy" UpdateText="Cập nhật" EditText="Sửa" />
                    <asp:TemplateField HeaderText="MaLogo" InsertVisible="False" 
                        SortExpression="MaLogo">
                        <EditItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Eval("MaLogo") %>'></asp:Label>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label1" runat="server" Text='<%# Bind("MaLogo") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="TenLogo" SortExpression="TenLogo">
                        <EditItemTemplate>
                            <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("TenLogo") %>'></asp:TextBox>
                        </EditItemTemplate>
                        <ItemTemplate>
                            <asp:Label ID="Label2" runat="server" Text='<%# Bind("TenLogo") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="DuongDanLogo" SortExpression="DuongDanLogo">
                        <EditItemTemplate>
                            <asp:Image ID="Image2" runat="server" 
                                ImageUrl='<%# Eval("DuongDanLogo", "~/{0}") %>' />
                        </EditItemTemplate>
                        <HeaderTemplate>
                            Hình ảnh
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:Image ID="Image1" runat="server" 
                                ImageUrl='<%# Eval("DuongDanLogo", "~/{0}") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Deleted" SortExpression="Deleted">
                        <EditItemTemplate>
                            <asp:DropDownList ID="DropDownList2" runat="server" DataValueField="Deleted"
                                SelectedValue='<% # Bind("Deleted") %>'>
                                 <asp:ListItem>0</asp:ListItem>
                                 <asp:ListItem>1</asp:ListItem>
                            </asp:DropDownList>
                        </EditItemTemplate>
                        <HeaderTemplate>
                            Đã xóa
                        </HeaderTemplate>
                        <ItemTemplate>
                            <asp:DropDownList ID="DropDownList1" runat="server" DataValueField="Deleted"
                                SelectedValue='<% # Bind("Deleted") %>' Enabled="false">
                                 <asp:ListItem>0</asp:ListItem>
                                 <asp:ListItem>1</asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
		    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:RAOVATConnectionString %>" 
                SelectCommand="SELECT * FROM [LOGO]" 
                UpdateCommand="UPDATE [LOGO] SET [TenLogo] = @TenLogo, [Deleted] = @Deleted WHERE [MaLogo] = @MaLogo">
                <UpdateParameters>
                    <asp:Parameter Name="TenLogo" Type="String" />
                    <asp:Parameter Name="DuongDanLogo" Type="String" />
                    <asp:Parameter Name="Deleted" Type="Int32" />
                    <asp:Parameter Name="MaLogo" Type="Int32" />
                </UpdateParameters>
            </asp:SqlDataSource>
            
            
		    <br />
            <table style="width: 100%">
                <tr>
                    <td style="width: 73px">
                        Tên logo</td>
                    <td align="left">
                        <asp:TextBox ID="txtTenLogo" runat="server" Width="145px"></asp:TextBox>
                    </td>
                    <td align="left">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td style="width: 73px">
                        Hình ảnh</td>
                    <td align="left">
                        <asp:FileUpload ID="fileUpload" runat="server" />
                    </td>
                    <td align="left">
                        &nbsp;</td>
                </tr>
                <tr>
                    <td style="width: 73px">
                        &nbsp;</td>
                    <td align="left">
                        <asp:Button ID="btnDongY" runat="server" Text="Đồng ý thêm" 
                            onclick="btnDongY_Click" />
                    </td>
                    <td align="left">
                        &nbsp;</td>
                </tr>
            </table>
            
            
		</div>
		</div>
				
		</div>
</asp:Content>
